package com.lagou.edu.demo.controller;

import com.lagou.edu.demo.service.OrderService;
import com.lagou.edu.mvcaframework.annotations.LagouAutowired;
import com.lagou.edu.mvcaframework.annotations.LagouController;
import com.lagou.edu.mvcaframework.annotations.LagouRequestMapping;
import com.lagou.edu.mvcaframework.annotations.LagouSecurity;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/** 订单控制器 */
@LagouRequestMapping("/order")
@LagouController
@LagouSecurity({"zhangsan", "lisi", "wangwu"})
public class OrderController {

  @LagouAutowired private OrderService orderService;

  @LagouRequestMapping("/query")
  @LagouSecurity({"zhangsan", "lisi"})
  public String queryOrder(HttpServletRequest request, HttpServletResponse response, String name) {
    System.out.println("订单查询条件名称为:" + name);
    String queryName = orderService.query(name);
    System.out.println(queryName);
    return queryName;
  }
}
